From: Daniel van Vugt Date: Thu, 19 Mar 2026 07:33:54 +0000 (+0800) Subject: Constify results from stdlib functions X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~10^2^2~93 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=38553e497fca7b3fb02c3d7a79b7a5716fa2c027;p=gnome-shell.git Constify results from stdlib functions This fixes recent warnings: ../src/st/croco/cr-rgb.c: In function ‘cr_rgb_set_from_name’: ../src/st/croco/cr-rgb.c:405:16: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 405 | result = bsearch (a_color_name, | ^ [150/294] Compiling C object src/libshell-18.so.p/shell-util.c.o ../src/shell-util.c: In function ‘shell_util_translate_time_string’: ../src/shell-util.c:165:7: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 165 | sep = strchr (str, '\004'); | ^ which seem to originate from: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=cd748a63ab1a7ae846175c532a3daab341c62690;hp=64b6813338d836ad1b61969a153192fb739f8722 Part-of: --- diff --git a/src/shell-util.c b/src/shell-util.c index da056a015..382fa2b45 100644 --- a/src/shell-util.c +++ b/src/shell-util.c @@ -153,7 +153,7 @@ shell_util_translate_time_string (const char *str) { const char *locale = g_getenv ("LC_TIME"); const char *res; - char *sep; + const char *sep; locale_t old_loc; locale_t loc = (locale_t) 0; diff --git a/src/st/croco/cr-rgb.c b/src/st/croco/cr-rgb.c index a2b478f7c..4691e961c 100644 --- a/src/st/croco/cr-rgb.c +++ b/src/st/croco/cr-rgb.c @@ -398,7 +398,7 @@ enum CRStatus cr_rgb_set_from_name (CRRgb * a_this, const guchar * a_color_name) { enum CRStatus status = CR_OK; - CRRgb *result; + const CRRgb *result; g_return_val_if_fail (a_this && a_color_name, CR_BAD_PARAM_ERROR);